<?php
/*code here*/
/* If user click the button/link to logged out. */
$db = new Database();
$auth = Auth::getAuth('current_user');
$user_id = $auth['id'];
$destroy = Auth::destroyAuth('current_user');
// Online Presence
    $set = array("online"=>0);
    $con = array("id"=>$user_id);
    $db->update("tbuser",$set,$con);
    
if($destroy){
    header('location: /');
}
?>
<script>
    $(".chatbox").remove();
</script>
<?php
/*code here(end)*/
exit;
$this->setLayout();
